package com.zhz.system.repository.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhz.common.tool.mybatisplus.base.dal.entity.BasePO;
import com.zhz.common.tool.mybatisplus.base.dal.repository.impl.BaseRepositoryImpl;
import com.zhz.model.system.PermissionApi;
import com.zhz.model.system.contract.dto.PermissionApiDTO;
import com.zhz.model.system.contract.param.PermissionApiQueryParam;
import com.zhz.system.repository.dao.PermissionApiDao;
import com.zhz.system.repository.service.PermissionApiService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 权限api服务实现
 *
 * @author zhouhengzhe
 * @date 2023/3/30
 */
@Service
public class PermissionApiServiceImpl extends BaseRepositoryImpl<PermissionApiDao, PermissionApiDTO, PermissionApi, PermissionApiQueryParam> implements PermissionApiService {
    @Override
    protected QueryWrapper<PermissionApi> getWrapper(PermissionApiQueryParam queryParam) {
        return new QueryWrapper<PermissionApi>()
                .eq(StringUtils.isNotBlank(queryParam.getId()), BasePO.ID, queryParam.getId())
                .eq(StringUtils.isNotBlank(queryParam.getPid()), PermissionApi.PID, queryParam.getPid())
                ;
    }
}
